package com.qf.service.impl;

import com.qf.dao.MerchantClassificationMapper;
import com.qf.entitys.MerchantClassification;
import com.qf.service.MerchantClassificationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MerchantClassificationServiceImpl implements MerchantClassificationService {

    @Resource
    private MerchantClassificationMapper mapper;

    @Override
    public int deleteByIds(Integer[] ids) {
        for (Integer id: ids) {
           int i= deleteByPrimaryKey(id);
            if(i==0){
                throw new RuntimeException("删除失败");
            }
        }
        return 1;
    }

    @Override
    public int deleteByPrimaryKey(Integer mcId) {
        return mapper.deleteByPrimaryKey(mcId);
    }

    @Override
    public int insert(MerchantClassification record) {
        return 0;
    }

    @Override
    public int insertSelective(MerchantClassification record) {
        return mapper.insertSelective(record);
    }

    @Override
    public MerchantClassification selectByPrimaryKey(Integer mcId) {
        return mapper.selectByPrimaryKey(mcId);
    }

    @Override
    public int updateByPrimaryKeySelective(MerchantClassification record) {
        return mapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(MerchantClassification record) {
        return 0;
    }

    @Override
    public List<MerchantClassification> selectAll() {
        return mapper.selectAll();
    }
}
